<?php
namespace Admin\Model;use Think\Model\RelationModel;class UserModel extends RelationModel{
	protected $_link = array(			'User'=>array(  							'mapping_type'      =>self::HAS_ONE,   								'class_name'        => 'User',   // 定义更多的关联属性 数据表								'mapping_name'      => 'Profile1',									'foreign_key'       => 'id',								'relation_foreign_key'=>'id',								//'relation_table'=>'km_middle',							  //  'as_fields' => 'userid',		   ),		   			'Integral'=>array(  							'mapping_type'      =>self::BELONGS_TO,   								'class_name'        => 'Integral',   // 定义更多的关联属性 数据表								'mapping_name'      => 'Profile2',									'foreign_key'       => 'userid',								//'relation_table'=>'km_middle',							//	'as_fields' => 'integral1',						   ),			  
	);
			
}